package com.itheima.day02;

import java.util.Arrays;

public class Sort {

    public void bubbleSort(int[] list) {

        int n = list.length;
        int tmp;
        for(int i = 0;i < n;i++)
            for(int j = 0;j < n-i-1;j++)
                if(list[j] > list[j+1]) {
                    tmp = list[j+1];
                    list[j+1] = list[j];
                    list[j] = tmp;
                }
        System.out.println(Arrays.toString(list));
    }

}
